#include "widget.h"
#include "ui_widget.h"

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);

    model=new ReplyModel(this);
    ui->tableView->setModel(model);

    start();
}

Widget::~Widget()
{
    delete ui;
}

void Widget::start()
{
    U8::Reply reply;
    reply.set_uid("1111");
    reply.add_column("AA");
    reply.add_column("BB");
    reply.add_column("CC");

    for(int i=0;i<10;i++)
    {
        U8::ResultItem *item=reply.add_result();
        item->add_item("A_" + std::to_string(i));
        item->add_item("B_" + std::to_string(i));
        item->add_item("C_" + std::to_string(i));
    }

    model->setReply(reply);
}

